From: kfraser@localhost.localdomain Date: Wed, 18 Oct 2006 16:59:04 +0000 (+0100) Subject: [NET] front/back: Avoid unaligned accesses to IP datagrams. These X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15589^2~41 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=bc29b3f70e402f9c2a5907f335d9cb4fc1fbba43;p=xen.git [NET] front/back: Avoid unaligned accesses to IP datagrams. These cause noisy warnings on IA64. Signed-off-by: Kouya SHIMURA Signed-off-by: Akio Takebe --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index 11fbf9503a..08c075ac27 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -187,7 +187,7 @@ static struct sk_buff *netbk_copy_skb(struct sk_buff *skb) if (unlikely(!nskb)) goto err; - skb_reserve(nskb, 16); + skb_reserve(nskb, 16 + NET_IP_ALIGN); headlen = nskb->end - nskb->data; if (headlen > skb_headlen(skb)) headlen = skb_headlen(skb); @@ -1210,7 +1210,7 @@ static void net_tx_action(unsigned long unused) ret < MAX_SKB_FRAGS) ? PKT_PROT_LEN : txreq.size; - skb = alloc_skb(data_len+16, GFP_ATOMIC); + skb = alloc_skb(data_len + 16 + NET_IP_ALIGN, GFP_ATOMIC); if (unlikely(skb == NULL)) { DPRINTK("Can't allocate a skb in start_xmit.\n"); netbk_tx_err(netif, &txreq, i); @@ -1218,7 +1218,7 @@ static void net_tx_action(unsigned long unused) } /* Packets passed to netif_rx() must have some headroom. */ - skb_reserve(skb, 16); + skb_reserve(skb, 16 + NET_IP_ALIGN); if (extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].type) { struct netif_extra_info *gso; diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 55101210d2..b75c986960 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -684,7 +684,7 @@ static void network_alloc_rx_buffers(struct net_device *dev) * necessary here. * 16 bytes added as necessary headroom for netif_receive_skb. */ - skb = alloc_skb(RX_COPY_THRESHOLD + 16, + skb = alloc_skb(RX_COPY_THRESHOLD + 16 + NET_IP_ALIGN, GFP_ATOMIC | __GFP_NOWARN); if (unlikely(!skb)) goto no_skb; @@ -702,7 +702,7 @@ no_skb: break; } - skb_reserve(skb, 16); /* mimic dev_alloc_skb() */ + skb_reserve(skb, 16 + NET_IP_ALIGN); /* mimic dev_alloc_skb() */ skb_shinfo(skb)->frags[0].page = page; skb_shinfo(skb)->nr_frags = 1; __skb_queue_tail(&np->rx_batch, skb);